package cn.yunhe.util;

import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

public class MultipartFileToFile {
    public static File translate( MultipartFile file) throws IOException {
        String fileName = file.getOriginalFilename();

        File dest = File.createTempFile("question", ".xlsx");

        file.transferTo(dest);
        return dest;
    }
    public static File translateUser( MultipartFile file) throws IOException {
        File dest = File.createTempFile("user", ".xlsx");
        file.transferTo(dest);
        return dest;
    }
}
